<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <input type="text" />
      <button>添加</button>
      <hr />
      <ul>
        <li v-for="item in list" :key="item.id">
          <input type="checkbox" v-model="item.checked" />
          {{item.name}}
          <button v-if="item.checked">删除</button>
        </li>
      </ul>
    </div>

    <script src="./Vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          list: [
            {
              id: 1,
              name: "zhangsan",
              checked: false,
            },
            {
              id: 2,
              name: "lisi",
              checked: false,
            },
            {
              id: 3,
              name: "wangwu",
              checked: false,
            },
            {
              id: 4,
              name: "zhaoliu",
              checked: false,
            },
          ],
        },
      });
    </script>
  </body>
</html>
